package com.example.jiagoujiexiang.Service.impl;

import com.example.jiagoujiexiang.Service.adminService;
import com.example.jiagoujiexiang.entity.User;
import com.example.jiagoujiexiang.entity.subscribe;
import com.example.jiagoujiexiang.Mapper.adminDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class adminServiceimpl implements adminService {

    private final adminDao adminDao;

    @Autowired
    public adminServiceimpl(adminDao adminDao) {
        this.adminDao = adminDao;
    }
    @Cacheable(cacheNames = "UserList")
    @Override
    public List<User> getUserListS() {
        for (int i = 0; i < adminDao.getUserList().size(); i++) {
            System.out.println(adminDao.getUserList().get(i).toString());
        }
        return adminDao.getUserList();
    }

    @Override
    public List<subscribe> getcatSubscribeListS() {
        return adminDao.getcatsSubscribeList();
    }
    @Override
    public List<subscribe> getdogSubscribeListS() {
        return adminDao.getdogsSubscribeList();
    }
}
